VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.MDIForm MDIForm1 
   BackColor       =   &H8000000C&
   Caption         =   "Jeevan Vaisya Agrotech"
   ClientHeight    =   5580
   ClientLeft      =   3600
   ClientTop       =   3480
   ClientWidth     =   8400
   LinkTopic       =   "MDIForm1"
   WindowState     =   2  'Maximized
   Begin MSComDlg.CommonDialog namechange 
      Left            =   3960
      Top             =   2520
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Menu file 
      Caption         =   "&Bond"
      Begin VB.Menu new 
         Caption         =   "&New"
      End
      Begin VB.Menu edit 
         Caption         =   "&Edit"
      End
   End
   Begin VB.Menu customer1 
      Caption         =   "&Renewal"
   End
   Begin VB.Menu empdet 
      Caption         =   "&Employee Details"
      Begin VB.Menu newent 
         Caption         =   "&New Entry"
      End
      Begin VB.Menu editent 
         Caption         =   "&Edit Entry"
      End
   End
   Begin VB.Menu achive1 
      Caption         =   "&Achive"
   End
   Begin VB.Menu salary1 
      Caption         =   "&Salary"
   End
   Begin VB.Menu cheque 
      Caption         =   "Che&que Entry"
   End
   Begin VB.Menu fin 
      Caption         =   "F&ind"
   End
End
Attribute VB_Name = "MDIForm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim intPaintFlag As Integer
 Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
 '--------------------------------------------------------------GetUserName--------------------------------------------------------------------
 Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
 '--------------------------------------------------------------GetComputerName-------------------------------------------------------------------
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub achive1_Click()
If jevlogin.Visible = False Then
Unload customer
Unload agentinfo
Unload Jeevan
Load achive
achive.Show
Unload salary
Unload Find
'Unload sendcheck
End If
End Sub
'Private Sub cheque_Click()
'If jevlogin.Visible = False Then
'Unload achive
'Unload agentinfo
'Unload Jeevan
'Unload customer
'Load sendcheck
'sendcheck.Show
'Unload salary
'Unload Find
'End If
'End Sub

Private Sub customer1_Click()
If jevlogin.Visible = False Then
Unload achive
Unload agentinfo
Unload Jeevan
Load customer
customer.Show
Unload salary
Unload Find
'Unload sendcheck
End If
End Sub
Private Sub edit_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload salary
Jeevan.Label1.Caption = "Select Reg. No"
Jeevan.txtregno.Visible = False
Jeevan.cbreg.Visible = True
Load Jeevan
Jeevan.Show
Unload Find
'Unload sendcheck
End If
End Sub
Private Sub editent_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload Jeevan
agentinfo.Label21.Visible = True
agentinfo.Combo2.Visible = True
agentinfo.Combo1.Visible = False
agentinfo.Text14.Visible = True
Load agentinfo
agentinfo.Show
Unload salary
Unload Find
'Unload sendcheck
End If
End Sub
Private Sub fin_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload Jeevan
Unload salary
Load Find
Find.Show
'Unload sendcheck
End If
End Sub

'---------------------------------------------------------SysGetComputerName-----------------------------------------------------------
Public Function SysGetComputerName() As String

Dim Computer As String
Dim BufSize As Long
Dim RetCode As Long
Dim NullCharPos As Long

Computer = Space(80)
BufSize = Len(Computer)

'call WINAPI
RetCode = GetComputerName(Computer, BufSize)

'Search for the end of the String
NullCharPos = InStr(Computer, Chr(0))

If NullCharPos > 0 Then
Computer = Left(Computer, NullCharPos - 1)
Else
Computer = ""
End If
SysGetComputerName = Computer
End Function

'--------------------------------------------------------------GetUserNameFunction-----------------------------------------------------------
Private Function sysGetUserName() As String
Dim UserName As String
'Dim BufSize1 As String
Dim RetCode As String
Dim NullCharPos As String

UserName = Space(80)
'BufSize1 = Len(UserName)

RetCode = GetUserName(UserName, Len(UserName))

NullCharPos = InStr(UserName, Chr(0))

If NullCharPos > 0 Then
UserName = Left(UserName, NullCharPos - 1)
Else
UserName = ""
End If
sysGetUserName = UserName
End Function
'-------------------------------------------------------------------------------------------------------------------------------------------------------------


'Private Sub Form_Load()
'Label2 = "User Name " & sysGetUserName
'Label3 = "Computer Name " & SysGetComputerName()
'End Sub
Private Sub Form_Paint() 'splash
If intPaintFlag = 0 Then
intPaintFlag = 1
Form1.Refresh
Sleep 4000
Sleep 4000
If UCase(SysGetComputerName()) <> UCase("system.") Then
End
End If
End If
End Sub
Private Sub MDIForm_Load()
Load jevlogin
jevlogin.Show

'Sleep 1000
'If Now > CDate("01/10/2010") Then End
'If SysGetComputerName() <> UCase("jeevangreen") Then
'MsgBox "YOUR NOT A VALID USER TO USE THIS PROGRAM"
'End
'End If
End Sub

Private Sub MDIForm_Unload(Cancel As Integer)
Dim FileSystemObject As Object
Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
'FileSystemObject.DeleteFile "F:\Backup\Jeevan.mdb"
'FileSystemObject.DeleteFile "F:\Backup\PlanA.mdb"
'FileSystemObject.DeleteFile "F:\Backup\PlanC.mdb"
'FileSystemObject.CopyFile App.Path & "\Jeevan.mdb", "F:\Backup\Jeevan.mdb"
'FileSystemObject.CopyFile App.Path & "\PlanA.mdb", "F:\Backup\PlanA.mdb"
'FileSystemObject.CopyFile App.Path & "\PlanC.mdb", "F:\Backup\PlanC.mdb"
End Sub

Private Sub new_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Load Jeevan
Jeevan.txtregno.Visible = True
Jeevan.cbreg.Visible = False
Jeevan.Label1.Caption = "CSS No."
Jeevan.Show
Unload salary
Unload Find
'Unload sendcheck
End If
End Sub
Private Sub newent_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload Jeevan
agentinfo.Label21.Visible = False
agentinfo.Combo2.Visible = False
agentinfo.Combo1.Visible = True
agentinfo.Text14.Visible = False
Call agentinfo.resettxt
Load agentinfo
agentinfo.Show
Unload salary
Unload Find
'Unload sendcheck
End If
End Sub
Private Sub salary1_Click()
If jevlogin.Visible = False Then
Unload customer
Unload achive
Unload agentinfo
Unload Jeevan
Load salary
salary.Show
Unload Find
'Unload sendcheck
End If
End Sub
